package com.simple.datax.flow.service;

import java.util.List;

import com.simple.datax.cache.model.TaskState;
import com.simple.datax.flow.dao.ibatis.model.FlowInstance;

/** 
 * @Title: FlowInstanceService.java 
 * @Package com.simple.datax.flow.service 
 * @Description: TODO(添加描述) 
 * @author tonney 
 * @date 2012-12-31 上午11:11:48 
 * @version V1.0 
 */
public interface TaskManager {
	/**
	 * 保存流程任务记录
	 * @param flowInstance
	 */
	public void saveFlowInstance(FlowInstance flowInstance);
	
	/**
	 * 校验任务ID
	 * @param taskid
	 * @return 1-任务id校验成功,2-任务id不合法,3-任务id是新建任务
	 */
	public int validateTaskid(String flowid,String taskid,String userid);
	
	/**
//	 * 根据任务ID获取任务状态信息,cache正常则从cache获取,cache异常则从数据库查询
//	 * @param taskId
//	 * @return
//	 */
//	public TaskState getTaskStateByTaskid(String taskId);
	
	/**
	 * 修改流程任务记录状态
	 * @param flowInstance
	 */
	public void updateFlowInstanceStatus(String taskid,int status);
	
	/**
	 * 根据任务ID获取流程模板ID
	 * @param taskid
	 * @return
	 */
	public String getFlowidByTaskid(String taskid);
	
	
}
